<div class="setting">
    <?php include PROJECT_PATH . 'Application/Web/View/Setting/menu.tpl.php';?>
    <div class="right">
    	<?php foreach ($members as $member){?>
		<div class="member">
			<div>
				Emil:<span class="info"><?=$member['member_email']?></span>
				<?php if($member['member_type']<2){ ?>
				<span onclick="setType(<?=$member['member_id']?>, <?=$member['member_type']+1?>)" class="func btn">升级</span>
				<?php } ?>
				<?php if($member['member_type']>0){ ?>
				<span onclick="setType(<?=$member['member_id']?>, <?=$member['member_type']-1?>)" class="func btn">降级</span>
				<?php } ?>
			</div>
			<div>昵称:<span class="info"><?=$member['member_nickname']?></span></div>
			<div>级别:<span class="info"><?php 
			    if($member['member_type'] == 0){
			       echo '用户';
			    }else if($member['member_type'] == 1){
			        echo '会员';
			    }else if($member['member_type'] == 2){
			        echo '管理员';
			    }else{
		            echo '异常';
			    }
			    ?></span>
			</div>
			<div>登录次数:<span class="info"><?=$member['member_count']?></span></div>
			<div>注册时间:<span class="info"><?=Web_Model_Common::getFormatTime($member['member_signup_time'])?></span></div>
			<div>登录时间:<span class="info"><?=Web_Model_Common::getFormatTime($member['member_last_time'])?></span></div>
		</div>
		<?php }?>
		<div class="page">
    		<span><a href="http://<?=HOST?>/setting/member/page/<?=$pageNav['firstPage']?>">[首页]</a></span>
    		<span><a href="http://<?=HOST?>/setting/member/page/<?=$pageNav['prePage']?>">[上一页]</a></span>
    		<?php foreach ($pageNav['pageList'] as $pageNum){ ?>
    		<span><a href="http://<?=HOST?>/setting/member/page/<?=$pageNum?>">[<?=$pageNum?>]</a></span>
    		<?php }?>
    		<span><a href="http://<?=HOST?>/setting/member/page/<?=$pageNav['nextPage']?>">[下一页]</a></span>
    		<span><a href="http://<?=HOST?>/setting/member/page/<?=$pageNav['lastPage']?>">[尾页]</a></span>
    	</div>
    </div>
</div>
<script type="text/javascript">
	function setType(id, type)
	{
		$.ajax({
			  url: "http://<?=HOST?>/setting/setMemberTypeAjax",
			  cache: false,
			  timeout:10000,
			  type: "POST",
			  data: {
				  member_id:id,
				  member_type:type
			  },
			  dataType: "json",
			  beforeSend: function() {
				  disableHTML(true, '请稍等，处理中……', true);
			  },
			  success: function(data) {
				  if(data.errCode != 0){
					disableHTML(true, data.errMsg, false);
	      	  		setTimeout(disableHTML,2000);
				  }else{
					disableHTML(true, '处理成功，跳转中……', true);
					setTimeout("location.href = 'http://<?=HOST?>/setting/member/page/<?=$pageNav['nowPage']?>'",2000);
				  }
			  },
			  error:function(){
      			disableHTML(true, "请求出错，请重试", false);
      			setTimeout(disableHTML,2000);
      		}
			});
	}
</script>








